package com.wzl.policy.factory;

import com.wzl.policy.strategyNew.FileUtilStrategy;
import com.wzl.policy.strategyNew.FtpStrategy;
import com.wzl.policy.strategyNew.SFtpStrategy;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 文件工具类工厂
 *
 * @author weizhongli
 * @since 2022-08-26 08:46
 */
@Component
public class FileUtilFactory {

    public static final Map<String, FileUtilStrategy> map = new HashMap(2);

    public FileUtilStrategy getStrategy(String key) {
        map.put("1", new SFtpStrategy());
        map.put("2", new FtpStrategy());
        FileUtilStrategy fileUtilStrategy = map.get(key);
        return fileUtilStrategy;
    }

}